<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查询所有委托信息</title>
    <link  href="../.././css/accountManage.css" rel="stylesheet" type="text/css"/>
    <link href="../.././css/font-awesome.css" rel="stylesheet"/>
    <link  href="../.././css/common.css" rel="stylesheet" />
    <script type="text/javascript" src="../.././js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="../.././js/google-maps.js"></script>
    <script>$(document).ready(function(){$(".vertical-nav").verticalnav({speed: 400,align: "left"});});</script>
</head>
<body>
<div id="Container">
    <div id="Header">
        <center><h1>股票交易系统前台资金用户界面</h1></center>
    </div>
    <div id="Content">
        <div id="Content-Left">
            <ul class="vertical-nav dark red">
                <li class="active"><a href="../../index.html"><i class="icon-home"></i>首页</a></li>
                <li><a href="  "><i class="icon-cogs"></i>委托管理
                    <span class="submenu-icon"></span></a>
                    <ul>
                        <li><a href="./deligationNew.html">创建新的委托</a></li>
                        <li><a href=". /deligationOrderQueryOrCancle.html ">查询或撤消委托订单</a></li>
                        <li><a href="./deligationAllOrder.html ">获得所有成交订单</a></li>
                        <li><a href="./getAlldeligation.html ">获得委托信息</a></li>
                    </ul>
                </li>
                <li><a href=" "><i class="icon-briefcase"></i>资金账户管理
                    <span class="submenu-icon"></span></a>
                    <ul>
                        <li><a href="./getMyfundflow.html">查询指定资金账户的资金流动</a></li>
                        <li><a href="./getMyAllstock.html">查询指定资金账户的所有用户持仓</a></li>
                        <li><a href="./getMyAccountInfo.html">获得用户资金信息</a></li>
                        <li><a href="./mybondManage.html">自选股管理</a></li>
                    </ul>
                </li>
                <li><a href="  "><i class="icon-user"></i>关于我们</a></li>
                <li><a href="  "><i class="icon-envelope"></i>联系我们</a></li>
            </ul>
        </div>
        <div id="Content-Right">
            <div  id="toolbar" class="toolbar">
                <h2 class="title">获得所有委托信息 </h2>
            </div>
            <!-- 数据修改面板-->
            <div  id="editPanel" style="overflow-x: hidden;margin: 0;padding:0;" >
                <form  id="p_select_form">
                    <table class="edittable" style="width:900px">
                        <tr style="height:0px;border: 0px;">
                            <td class="right" style="width:130px;border: 0px;"></td>
                            <td class="left" style="width:310px;border: 0px;"></td>
                            <td class="right" style="width:130px;border: 0px;"></td>
                            <td class="left" style="border: 0px;"></td>
                        </tr>
                        <tr>
                            <td class="right" style="width:130px;border-top: 0px;">输入委托单号： </td>
                            <td class="left" style="width:100px"><input type="text" id="id" name="id" class="input"maxlength="18"  placeholder="请输入账号" watermark="请输入账号" /></td>
                                <button class="btnblue"id="getAlldeoredr" useable="edit" onclick="getDeligationInfo()" >搜索</button>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
            <!--数据查询显示区-->
            <div id="querylist">
                <table id="deligOTable" style="display:none;" >
                    <thead>
                    <tr>
                        <th style="width:10%;">委托单号</th>
                        <th style="width:10%;">账户ID</th>
                        <th style="width:15%;">证券代码</th>
                        <th style="width:15%;" >证券名称</th>
                        <th style="width:10%;">操作方向</th>
                        <th style="width:15%;">申请数量</th>
                        <th style="width:15%;">申请价格</th>
                        <th style="width:15%;">市场均价</th>
                        <th style="width:15%;">交易市场</th>
                        <th style="width:15%;">货币种类</th>
                        <th style="width:15%;">成交价格</th>
                        <th style="width:15%;">成交数量</th>
                    </tr>
                    </thead>
                    <tbody id="infoByid">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id="Footer"> <p></font>COPYRIGHT2017-2017 &copy;<BR></font></p></div>
</div>
</body>
</html>

<script type="text/javascript">

    function getDeligationInfo(){
        var tbody=window.document.getElementById("infoByid");
        var data = $("#p_select_form").serialize();
        $.param(data);
        $.ajax({
            url: "../../delegation" + data,
            type: "GET",
            // processData:false,
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            dataType: "json",
            success: function (data) {
                console.log(data);
                if (data.code == 0) {
                    var str = "";
                    var tdata = data.object;
                    for (i in tdata) {
                        str += "<tr>" + "<td>" + tdata[i].delegationid + "</td>" + "<td>" + tdata[i].caccountid + "</td>" + "<td>" + tdata[i].securityid + "</td>"
                            + "<td>" + tdata[i].securityname + "</td>" + "<td>" + tdata[i].delegationdirection + "</td>" + "<td>" + tdata[i].delegationnum + "</td>"
                            + "<td>" + tdata[i].delegationprice + "</td>" + "<td>" + tdata[i].evenprice + "</td>" + "<td>" + tdata[i].tradingmarkete + "</td>"
                            + "<td>" + tdata[i].currency + "</td>" + "<td>" + tdata[i].bargainamount + "</td>" + "<td>" + tdata[i].delegationtime + "</td>"
                            + "</tr>";
                        tbody.innerHTML = str;
                    }
                }
            },
            error: function () {
                alert("查询失败！");
            }
        });
    }

</script>
